/* 
 * File:   QImageDisplay.cpp
 * Author: matt
 * 
 * Created on 16 May 2010, 19:46
 */

#include "QImageDisplay.h"

QImageDisplay::QImageDisplay() {
    layout = new QGridLayout(this);
    image= QImage(640,480,QImage::Format_RGB32);
    //this->setFixedSize(image.width(), image.height());

}

QImageDisplay::~QImageDisplay() {
}

void QImageDisplay::paintEvent(QPaintEvent *event) {
    QPainter widgetPainter(this);
    widgetPainter.drawImage(0,0,image);
    widgetPainter.end();
    return;
}
void QImageDisplay::setImage(QImage passed_image)
{
    image = passed_image;//.scaledToHeight(480);
    this->setFixedSize(image.width(), image.height());
    this->repaint();
}
